package com.moyun.zbmy.zizhou.ui.adapter.holder;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.moyun.zbmy.zizhou.R;
import com.moyun.zbmy.zizhou.ui.util.IListShowData;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by rh008 on 2017/7/13.
 */

public class TvHolder extends BaseAbsHolder<IListShowData> {

    @BindView(R.id.iv_dianshi)
    protected ImageView iv_dianshi;

    @BindView(R.id.iv_guangbo)
    protected ImageView iv_guangbo;
    private OnSelectListener listener;


    public TvHolder(Context context, View itemView, OnSelectListener listener) {
        super(context, itemView);
        this.listener = listener;
    }

    @Override
    protected void initInject() {
        ButterKnife.bind(this, itemView);
    }

    @Override
    public void setData(IListShowData iListShowData) {
        String text = iListShowData.getDataTitle();
        iv_dianshi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                listener.OnSelectListener(0);
            }
        });

        iv_guangbo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
               listener.OnSelectListener(1);
            }
        });
    }


    public interface OnSelectListener{
        void OnSelectListener(int pos);
    }



}
